SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO


CREATE VIEW dbo.[DnnProduct_vw_SearchItems]
AS
    SELECT     
		si.SearchItemID, 
		m.PortalID, 
		tm.TabID, 
		m.ModuleID, 
		si.Title, 
		si.Description, 
		si.Author, 
		si.PubDate, 
		si.SearchKey, 
		si.Guid, 
		si.HitCount, 
        si.ImageFileId, 
        u.DisplayName AS AuthorName
	FROM  dbo.DnnProduct_SearchItem AS si 
		LEFT OUTER JOIN dbo.DnnProduct_Users AS u ON si.Author = u.UserID 
		INNER JOIN dbo.DnnProduct_Modules AS m ON si.ModuleId = m.ModuleID 
		INNER JOIN dbo.DnnProduct_TabModules AS tm ON m.ModuleID = tm.ModuleID
GO
